# -*- coding:utf-8 -*-
# @FileName  :ent_dic.py
# @Time      :2020/12/10 14:09
# @Author    :Zhoujirong
# @Desc      :
from common.http_request import Request
from biz.support.urls import ServerUrl
class EntDicRequest:
    @classmethod
    def create_dic(cls,type,
                    value,
                    code,
                    remark,cookie):
        data = {
            'type':type,
            'value':value,
            'code':code,
            'remark':remark
        }
        req = Request(ServerUrl.ent_dic_add_url,data=data,headers=cookie)
        return req.post()

    @classmethod
    def detail(cls,id,cookie):
        data = {
            'id':id
        }
        req = Request(ServerUrl.ent_dic_detail_url,data=data,headers=cookie)
        return req.post()

    @classmethod
    def get_page(cls,curPage,
            maxSize,
            search_LIKE_type,
            search_LIKE_value,cookie):
        data = {
            'curPage':curPage,
            'maxSize':maxSize,
            'search_LIKE_type':search_LIKE_type,
            'search_LIKE_value':search_LIKE_value
        }
        req = Request(ServerUrl.ent_dic_get_page_url,params=data,headers=cookie)
        return req.get()

    @classmethod
    def update(cls,checked,
                    code,
                    ext1,
                    ext2,
                    ext3,
                    ext4,
                    ext5,
                    ext6,
                    id,
                    remark,
                    resCode,
                    resMsg,
                    serialNumber,
                    type,
                    value,cookie):
        data = {
            'checked':checked,
            'code':code,
            'ext1':ext1,
            'ext2':ext2,
            'ext3':ext3,
            'ext4':ext4,
            'ext5':ext5,
            'ext6':ext6,
            'id':id,
            'remark':remark,
            'resCode':resCode,
            'resMsg':resMsg,
            'serialNumber':serialNumber,
            'type':type,
            'value':value
        }
        req = Request(ServerUrl.ent_dic_update_url,data=data,headers=cookie)
        return req.post()

    @classmethod
    def delete(cls,ids,cookie):
        data = {
            'ids':ids
        }
        req = Request(ServerUrl.ent_dic_del_url,params=data,headers=cookie)
        return req.post()





if __name__ == "__main__":
    pass